package study.saas.order.facade.impl;

import com.alibaba.dubbo.config.annotation.Service;
import org.springframework.stereotype.Component;
import study.saas.common.viewmodel.ApiResultV2;
import study.saas.common.viewmodel.PageModel;
import study.saas.order.entity.Commodity;
import study.saas.order.service.CommodityFacade;
import study.saas.order.service.CommodityService;
import study.saas.order.service.model.CommodityFilterDTO;
import study.saas.order.service.model.CommodityModifyDTO;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author ctc
 */
@Component("CommodityFacade")
@Service(version = "1.0.0")
public class CommodityFacadeImpl implements CommodityFacade {
    @Resource
    private CommodityService service;

    @Override
    public Commodity findOne(Integer id) {
        return null;
    }

    @Override
    public Commodity save(Commodity entity) {

        return null;
    }

    @Override
    public List<Commodity> save(List<Commodity> entityList) {
        return null;
    }

    @Override
    public void deleteById(Integer id) {

    }

    @Override
    public ApiResultV2<Commodity> addCommodity(CommodityModifyDTO commodity) {
        return service.create(commodity);
    }

    @Override
    public ApiResultV2<Commodity> setCommodity(CommodityModifyDTO commodity) {
        return service.modify(commodity);
    }

    @Override
    public ApiResultV2<Commodity> findCommodity(String commodityName) {
        return service.findCommodity(commodityName);
    }

    @Override
    public ApiResultV2<PageModel<Commodity>> list(CommodityFilterDTO filter) {
        return service.list(filter);
    }

    @Override
    public ApiResultV2<Commodity> setClass(Integer state) {
        return null;
    }

    @Override
    public ApiResultV2<Commodity> decreaseCommodity(String commodityName) {
        return null;
    }

    @Override
    public ApiResultV2<Commodity> deleteCommodity(String commodityName) {
        return service.deleteCommodity(commodityName);
    }

    @Override
    public ApiResultV2 setAmount(Boolean flag, String commodityName, Integer num) {
        return service.setAmount(flag, commodityName, num);
    }



}
